#include<vector>
#include<unordered_map>
#include<map>
#include<iostream>
using namespace std;

vector<int> findAnagrams(string s, string p) {
    unordered_map<char, int> hash1, hash2;
    vector<int> ret;
    int m = p.size();
    int n = s.size();
    for (auto x : p) hash2[x]++;
    int count = 0;
    for (int left = 0, right = 0; right < n; right++)
    {
        hash1[s[right]]++;
        if (hash1[s[right]] <= hash2[s[right]]) count++;
        if (right - left + 1 > m)
        {
            if (count == m) ret.push_back(left);
            if (hash1[s[left]] <= hash2[s[left]])
            {
                count--;
                hash1[s[left]]--;
            }
            left++;
        }
    }
    return ret;
}
int main()
{
	/*unordered_map<char, int> hash1;
	unordered_map<char, int> hash2;
	hash1['f']++;
	hash1['a']++;
	hash1['c']++;
	hash2['a']++;
	hash2['c']++;
	hash2['f']++;
	hash2['b'];
	if (hash1 == hash2)
	{
		cout << 1 << endl;
	}*/

    findAnagrams("cbaebabacd", "abc");
    int hash1[26] = { 0 }, hash2[26] = { 0 };
    hash1[0] = hash2[0] = hash1[1] = hash1[2] = hash2[1] = hash2[2] = 1;
    if (hash1 == hash2)
        cout << 1;

	return 0;
}